package pl.edu.agh.gronoMining.frequentSubgraphFinder.frequentSearcher.subgraph;

import pl.edu.agh.gronoMining.frequentSubgraphFinder.graph.GraphException;

/**
 * Represents list of StartNodeSubgraph.
 */
public interface StartNodeSubgraphList {

	/**
	 * Add element to list
	 * @param startNodeSungraph subgraph to add
	 */
	public void addStartNodeSubgraph(StartNodeSubgraph startNodeSungraph);
	
	/**
	 * @return first startNodeSungraph from list
	 */
	public StartNodeSubgraph getFirstStartNodeSubgraph();
	
	/**
	 * Removes subgraph from list
	 * @param startNodeSungraph subgraph to remove
	 */
	public void remove(StartNodeSubgraph startNodeSungraph);
	
	/**
	 * @return number of elements in list
	 */
	public int size();
	
	/**
	 * Performs move on all subgraphs from list
	 * @param move move to perform
	 * @return list of subgraphs where move was successful
	 * @throws GraphException
	 */
	public StartNodeSubgraphList performMove(SubgraphMove move) throws GraphException;
	
	/**
	 * Undo last move on all subgraphs from list
	 * @throws GraphException
	 */
	public void undoLastMove() throws GraphException;
	
	/**
	 * On all subgraphs from list marks edge from last move as frequent or unfrequent
	 * @param isFrequent true when edge is frequent, false when unfrequent
	 */
	public void markLastMoveEdge(boolean isFrequent);
	
	/**
	 * On all subgraphs from list marks edge from last move as frequent or unfrequent
	 * @param isFrequent true when edge is frequent, false when unfrequent
	 * @param dfs dfs of current graph
	 */
	public void markLastMoveEdge(boolean isFrequent, DFSCode dfs);
	
}
